<template>
	<el-dialog :title="titleMap[mode]" v-model="visible" width="85%" destroy-on-close @closed="$emit('closed')" align-center>
        <scTable ref="table" :data="dataList" stripe border show-summary hideDo hidePagination height="450">
            <el-table-column label="日账单编号" prop="order_no" align="center"></el-table-column>
            <el-table-column label="工厂" prop="referred_as" align="center"></el-table-column>
            <el-table-column label="客户" prop="custom_name" align="center"></el-table-column>
            <el-table-column label="下单数量" prop="order_num" align="center"></el-table-column>
            <el-table-column label="发货数量" prop="send_num" align="center"></el-table-column>
            <el-table-column label="入库数量" prop="storage_num" align="center"></el-table-column>
            <el-table-column label="金额" prop="money" align="center"></el-table-column>
            <el-table-column label="状态" align="center">
                <template #default="scope">
                    <el-tag v-if="scope.row.is_bill==0" type="danger">未生成</el-tag>
                    <el-tag v-else type="success">已生成</el-tag>
                </template>
            </el-table-column>
            <el-table-column label="添加时间" align="center" prop="create_time"></el-table-column>
        </scTable>
        <el-footer style="display:flex;justify-content: end;">
            <el-button @click="visible = false">关 闭</el-button>
        </el-footer>
	</el-dialog>
</template>

<script>
export default {
	emits: ['success', 'closed'],
	data() {
		return {
			mode: "add",
			titleMap: {
				add: '选择扣款单',
                edit:"扣款单详情",
			},
			visible: false,
            dataList:[],
            dialog:{
                bill:false,
            },
		}
	},
	methods: {
		//显示
		open(mode = 'add') {
			this.mode = mode;
			this.visible = true;
			return this
		},
        async setData(data){
            var res = await this.$API.inventory.BillDayDetail.get({day_bill_ids:data.day_bill_ids,is_finance:1});
            this.dataList = res.data;
        },
	}
}
</script>

<style>
.table .selected-row {
  background-color: #F00;
  /* 或者其他样式 */
}
</style>
